<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Kuyuan\Phpwidget\Date;

class RedForm extends Model
{
    use HasFactory;
    protected $fillable = [
        'member_id',
        'red_id',
        'form_content'
    ];
    protected $casts = [
        'form_content' => 'array',
    ];

    /**
     * 表单提交时间
     */
    public function getCreateTimeAttribute()
    {
        return Date::shortFormat(strtotime($this->created_at));
    }
}
